/*
 *  Memoria fisica
 */

#ifndef SP_MMU_PHYSICAL_H
#define SP_MMU_PHYSICAL_H


#define PHY_MAX_PAGE	1048576
#define PHY_PAGE_SIZE 	4
#define PHY_MAX_BLOCKS	PHY_MAX_PAGE / 32


typedef struct
{
	void *address;
	unsigned dim;
} phy_page_t;


// Array che contiene le allocazioni
phy_page_t phy_allocated[PHY_MAX_BLOCKS];

// La bitmap della memoria fisica
unsigned phy_bitmap[PHY_MAX_PAGE];

// Numero di pagine
unsigned phy_page_number;


int phy_first_free_alloc();
void phy_init();
unsigned phy_get_nfree_pages();
void *phy_get_pages(unsigned);
void phy_relase_pages(void *);
unsigned phy_tot_pages();

#endif
